package com.gitee.wsl.platform.network.dnssd

import android.Manifest
import android.annotation.SuppressLint
import android.content.Context
import android.content.pm.PackageManager
import android.net.nsd.NsdManager
import android.net.wifi.WifiManager
import com.gitee.wsl.platform.Platform
import com.gitee.wsl.platform.appContext


internal val nsdManager: NsdManager by lazy {
    Platform.appContext.getSystemService(NsdManager::class.java)
}
internal val wifiManager: WifiManager by lazy {
    Platform.appContext.getSystemService(WifiManager::class.java)
}

internal fun multicastPermissionGranted() = Platform.appContext.checkSelfPermission(
    Manifest.permission.CHANGE_WIFI_MULTICAST_STATE
      ) == PackageManager.PERMISSION_GRANTED
